﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectList.aspx.cs" Inherits="MaluJg.web.ProjectFund.ProjectList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>项目列表</title>
    <link href="../style/css/project.css" rel="stylesheet" type="text/css" />
     <script>
        function addProject() {
            window.showModalDialog('AddItem.aspx?DepartmentID=<%=DepartmentID %>&nocache=' + Math.random(), '', "dialogWidth:320px;dialogHeight:240px;status:yes;resizable:no");
            document.getElementById("btnRefresh").click();
        }
        function openEdit(id) {
            window.showModalDialog('AddItem.aspx?DepartmentID=<%=DepartmentID %>&ProjectID=' + id + '&nocache=' + Math.random(), '', "dialogWidth:320px;dialogHeight:240px;status:yes;resizable:no");
            document.getElementById("btnRefresh").click();
        }

        function openForm(id) {
            var width = 800;
            var height = 600;
            var s1 = screen.width;
            var s2 = screen.height;
            //alert(1);
            window.open('ProjectFrame.aspx?ProjectID=' + id + '&nocache=' + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,left=' + (s1 - width) / 2 + ',top=' + (s2 - height) / 2);
            //alert(2);
            //document.getElementById("btnRefresh").click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
   <div style="display: none">
        <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" />
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" background="../style/img/TitleBg.jpg">
        <tr>
            <td height="24">
                &nbsp;&nbsp;项目列表
            </td>
            <td align="right">
                <a href="#" onclick="addProject();">
                    <img src="/UI%20Standard/icon/action/add.gif" align="absmiddle" />&nbsp;新增</a>&nbsp;
            </td>
        </tr>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="400" align="center" valign="top">
                <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                    <tr height="21">
                        <td width="9%" height="22" align="center" bgcolor="#FFFFFF">
                            序号
                        </td>
                        <td height="22" colspan="2" align="center" bgcolor="#FFFFFF">
                            项目名称
                        </td>
                        <td width="21%" style="display:none"  height="22" align="center" bgcolor="#FFFFFF">
                            建设单位
                        </td>
                        <td width="9%" height="22" align="center" bgcolor="#FFFFFF">
                            编辑
                        </td>
                        <td width="9%" height="22" align="center" bgcolor="#FFFFFF">
                            删除
                        </td>
                    </tr>
                    <asp:Repeater ID="rptItem" runat="server" OnItemDataBound="rptItem_ItemDataBound">
                        <ItemTemplate>
                            <tr height="21">
                                <td height="22" align="center" bgcolor="#FFFFFF">
                                    <%# Container.ItemIndex+1%>
                                </td>
                                <td height="22" colspan="2" align="left" bgcolor="#FFFFFF">
                                    &nbsp;<a href="#" onclick="openForm('<%# DataBinder.Eval(Container.DataItem, "ID") %>');"><%# DataBinder.Eval(Container.DataItem, "Name") %></a>
                                </td>
                                <td height="22" align="center" style="display:none"  bgcolor="#FFFFFF">
                                    <%# DataBinder.Eval(Container.DataItem, "DepartmentDisplayName") %>
                                </td>
                                <td width="9%" height="22" align="center" bgcolor="#FFFFFF">
                                    <a href="#" onclick="openEdit('<%# DataBinder.Eval(Container.DataItem, "ID") %>');">
                                        编辑</a>
                                </td>
                                <td width="9%" height="22" align="center" bgcolor="#FFFFFF">
                                    <asp:LinkButton ID="lbtnDelete" runat="server" OnClientClick="return window.confirm('确认删除?');">删除</asp:LinkButton>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
